/** @jsxImportSource @emotion/react */
import * as React from "react";
import {
  Text,
  useTheme,
  Container,
  Button,
  SuffixInput,
  IconArrowRight,
  Input,
  Select,
  InputDatalist, CheckSwitch,
  ComboBoxDatalist, InputLine, LineColumn,
  CommitInput
} from "customize-easy-ui-component";

//import queryString from "querystring";
import {useCommnBaseParm, CommnBase} from "./CommnBase";
import {拖动方式, 控制方式, 缓冲器形式} from "./电梯";
import {设备等级} from "./起重";
import HashLinkObserver from "react-hash-link";

import queryString from "query-string";
//工作级别"WORKGRADE" 检验平台sort=4800：升降机WORK_LEVL； 监察平台没有独立表还是WORKGRADE字段;
//删除字段: 是否型式试验样机 IF_TEST;
export const 工作级别=['A1','A2','A3','A4','A5'];     //监察没有几条有数据的!
export const 节联接方式=['其他'];
export const 层门型式=['其他'];
export const 层门形式=['其他'];
export const 电动机类型s=['其他'];
export const 附属装置品种=['其他'];
export const 工作方式s=["司机室操作","地面操作","司机室","地面+司机室","其它"];

//DOOR_CLOSE_TYPE
export const 关门驱动式=['动力驱动的非自动门',"动力驱动的自动门","手动门",'其他'];
//DOOR_DRIVE_TYPE
export const 门驱动方式=["动力驱动的非自动门","动力驱动的自动门","手动门",'其他'];

export const 开门方向=['旁开门',"中分门","旁开双折","右开门",'其他'];
export const 适用场合=["室内","室外","露天","非露天"];

//可嵌套的编辑器；传递保存变动数据。 中文可用，但是引用时刻会告警徐改成英文<As...>
interface 升降机props {
  id?: string;
  readOnly?: boolean;
  editable?: boolean;
  //当前设备数据(确认修改之后)
  eqp?:any;
  //去修改设备数据
  //setEqp:  React.Dispatch<React.SetStateAction<any>>;
  mutationFunc: (...args: any[]) => any;
}
/**
 *升降机不是一般的 起重 类别； 实际上升降机参数更应该像是 电梯的。
 * 监察平台升降机有单独技术参数表。
 * 对照旧平台还未加入的参数： "驱动设备"？
 * */
export const 升降机: React.FunctionComponent<升降机props> = ({
       readOnly,
       id,
       editable,
       eqp=null,
       mutationFunc,
     }) =>
{
  //const qs= queryString.parse(window.location.search);
  const theme = useTheme();
  const {save}= window.history.state?.state??{};      //通用伪对话框传递格式
  //const edt = ndt&&qs?.emodel==='设备'&&ndt.id===eqp.id?  ndt : eqp;
  //伪对话框旧方案依赖Context queryString传递恢复编辑器状态；新方案改成依赖history传递恢复。
  const edt = save?  save : eqp;

  const [flo, setFlo] = React.useState(edt.flo);
  const [jobl, setJobl] = React.useState(edt.jobl);
  const [vls, setVls] = React.useState(edt.vls);
  const [rtlf, setRtlf] = React.useState(edt.rtlf);
  const [opm, setOpm] = React.useState(edt.opm);
  const [cpi, setCpi] = React.useState(edt.cpi);
  const [cpm, setCpm] = React.useState(edt.cpm);
  const [mom, setMom] = React.useState(edt.mom);
  const [nnor, setNnor] = React.useState(edt.nnor);
  const [twoc, setTwoc] = React.useState(edt.twoc);
  const [hlf, setHlf] = React.useState(edt.hlf);
  const [tm, setTm] = React.useState(edt.tm);
  const [tno, setTno] = React.useState(edt.tno);
  const [ns, setNs] = React.useState(edt.ns);
  const [level, setLevel] = React.useState(edt.level);
  const [occa, setOcca] = React.useState(edt.occa);

  //const  svp = JSON.parse(edt?.svp || '{}');
  const  svp = edt?.svp;
  const [节联接, set节联接] = React.useState(svp?.节联接);
  const [层门型, set层门型] = React.useState(svp?.层门型);
  const [层门式, set层门式] = React.useState(svp?.层门式);
  const [传动, set传动] = React.useState(svp?.传动);
  const [葫芦号, set葫芦号] = React.useState(svp?.葫芦号);
  const [葫芦型, set葫芦型] = React.useState(svp?.葫芦型);
  const [电动机类, set电动机类] = React.useState(svp?.电动机类);
  const [电机号, set电机号] = React.useState(svp?.电机号);
  const [电机型, set电机型] = React.useState(svp?.电机型);
  const [对绳径, set对绳径] = React.useState(svp?.对绳径);
  const [额定载人, set额定载人] = React.useState(svp?.额定载人);
  const [坠保护, set坠保护] = React.useState(svp?.坠保护);
  const [附属种, set附属种] = React.useState(svp?.附属种);
  const [工作式, set工作式] = React.useState(svp?.工作式);
  const [缓冲器, set缓冲器] = React.useState(svp?.缓冲器);
  const [对重块数, set对重块数] = React.useState(svp?.对重块数);
  const [笼数, set笼数] = React.useState(svp?.笼数);
  const [限速器型, set限速器型] = React.useState(svp?.限速器型);
  const [门式, set门式] = React.useState(svp?.门式);
  const [门驱动, set门驱动] = React.useState(svp?.门驱动);
  const [门方向, set门方向] = React.useState(svp?.门方向);
  const [伸展, set伸展] = React.useState(svp?.伸展);
  const [是防爆, set是防爆] = React.useState(svp?.是防爆);
  const [绝缘, set绝缘] = React.useState(svp?.绝缘);
  const [有附装, set有附装] = React.useState(svp?.有附装);
  const [拖动, set拖动] = React.useState(svp?.拖动);
  const [绳数, set绳数] = React.useState(svp?.绳数);
  const [绳直径, set绳直径] = React.useState(svp?.绳直径);
  const [最工幅, set最工幅] = React.useState(svp?.最工幅);
  const [最大幅, set最大幅] = React.useState(svp?.最大幅);

  const  pa = edt?.pa;
  const [钳型号, set钳型号] = React.useState(pa?.钳型号);
  const [钳编号, set钳编号] = React.useState(pa?.钳编号);
  const [电机功率, set电机功率] = React.useState(pa?.电机功率);
  const [电机转速, set电机转速] = React.useState(pa?.电机转速);
  const [顶层高度, set顶层高度] = React.useState(pa?.顶层高度);
  const [对重轨距, set对重轨距] = React.useState(pa?.对重轨距);
  const [额定电流, set额定电流] = React.useState(pa?.额定电流);
  const [防爆标志, set防爆标志] = React.useState(pa?.防爆标志);
  const [坠安号, set坠安号] = React.useState(pa?.坠安号);
  const [坠安型, set坠安型] = React.useState(pa?.坠安型);
  const [缓编号, set缓编号] = React.useState(pa?.缓编号);
  const [缓型号, set缓型号] = React.useState(pa?.缓型号);
  const [缓厂家, set缓厂家] = React.useState(pa?.缓厂家);
  const [轿厢轨距, set轿厢轨距] = React.useState(pa?.轿厢轨距);
  const [轨架高, set轨架高] = React.useState(pa?.轨架高);
  const [笼数检, set笼数检] = React.useState(pa?.笼数检);
  const [对块数检, set对块数检] = React.useState(pa?.对块数检);
  const [附墙架, set附墙架] = React.useState(pa?.附墙架);
  const [下限电速, set下限电速] = React.useState(pa?.下限电速);
  const [下限机速, set下限机速] = React.useState(pa?.下限机速);
  const [限速器号, set限速器号] = React.useState(pa?.限速器号);
  const [门数, set门数] = React.useState(pa?.门数);
  const [环境, set环境] = React.useState(pa?.环境);
  const [速比, set速比] = React.useState(pa?.速比);
  const [提绳径, set提绳径] = React.useState(pa?.提绳径);
  const [限机械速, set限机械速] = React.useState(pa?.限机械速);
  const [限绳直径, set限绳直径] = React.useState(pa?.限绳直径);
  const [曳引比, set曳引比] = React.useState(pa?.曳引比);
  const [型试样, set型试样] = React.useState(pa?.型试样);
  const [轮节径, set轮节径] = React.useState(pa?.轮节径);
  const [自由高, set自由高] = React.useState(pa?.自由高);
  const [用途, set用途] = React.useState(pa?.用途);
  const [独立高, set独立高] = React.useState(pa?.独立高);
  const [作业人, set作业人] = React.useState(pa?.作业人);
  const [笼行程, set笼行程] = React.useState(pa?.笼行程);
  //肢解可复用的共同组件模式： Hook + 配套的组件。
  const cbp =useCommnBaseParm(eqp, svp, pa, save);

  async function confirmation() {
    const newdat={ ...eqp,  ...cbp.out,
      flo,vls,rtlf,jobl,opm,cpi,cpm,mom,nnor,
      twoc,hlf,tm,tno,ns,level,occa,
      svp: { ...cbp.svpO,
        节联接,层门型,层门式,传动,葫芦号,葫芦型,电动机类,电机号,电机型,
        对绳径,额定载人,坠保护,附属种,工作式,缓冲器,笼数,对重块数,限速器型,门式,
        门驱动,门方向,伸展,是防爆,绝缘,有附装,拖动,绳直径,绳数,最工幅,最大幅,
        }
      ,
      pa: { ...cbp.paO,
        钳编号,钳型号,电机功率,电机转速,顶层高度,对重轨距,额定电流,防爆标志,
        笼数检,对块数检,坠安号,坠安型,缓编号,缓型号,缓厂家,轿厢轨距,轨架高,
        附墙架,下限电速,下限机速,限速器号,门数,环境,速比,提绳径,限机械速,
        限绳直径,曳引比,型试样,轮节径,自由高,用途,独立高,作业人,笼行程,
        }

    };

    return newdat;
  }


  return (
    <div
      css={{
        [theme.mediaQueries.md]: {
          height: "auto",
          display: "block"
        }
      }}
    >
      <hr/>
      <Text
        css={{
          flex: 1,
          textAlign: "center",
          [theme.mediaQueries.md]: {
            textAlign: "left"
          }
        }}
        wrap={false}
        variant="h5"
        gutter={false}
      >
        {eqp.cod} 升降机技术参数
      </Text>

      <div
        css={{
          flex: 1,
          [theme.mediaQueries.md]: {
            flex: "none"
          }
        }}
      >
        <div>
          <Container>
            <div
              css={{
                paddingTop: theme.spaces.lg,
                paddingBottom: theme.spaces.lg
              }}
            >

            <CommnBase cbp={cbp} id={id!}  confirmation={confirmation}/>
            <Text variant="h5">升降机参数</Text>
            <LineColumn >
              <HashLinkObserver />
              <InputLine label={`设备等级:`}>
                <ComboBoxDatalist  value={ level || ''}  datalist={设备等级}
                              onListChange={v => setLevel( v||undefined ) } />
              </InputLine>
              <InputLine label={`适用场合:`}>
                <InputDatalist value={ occa || ''} datalist={适用场合}
                               onListChange={v => setOcca(v ||undefined)} />
              </InputLine>
              <InputLine label={`安全钳编号:`}>
                <CommitInput  value={ 钳编号 || ''}  onSave={txt => set钳编号(txt||undefined) } />
              </InputLine>
              <InputLine label={`安全钳型号:`}>
                <CommitInput  value={ 钳型号 || ''}  onSave={txt => set钳型号(txt||undefined) } />
              </InputLine>
              <InputLine label={`标准节联接方式:`}>
                <InputDatalist value={ 节联接 || ''} datalist={节联接方式}
                               onListChange={v => set节联接(v ||undefined)} />
              </InputLine>
              <InputLine label={`层门型式:`}>
                <InputDatalist value={ 层门型 || ''} datalist={层门型式}
                               onListChange={v => set层门型(v ||undefined)} />
              </InputLine>
              <InputLine label={`层门形式:`}>
                <InputDatalist value={ 层门式 || ''} datalist={层门形式}
                               onListChange={v => set层门式(v ||undefined)} />
              </InputLine>
              <InputLine label={`层数:`}>
                <SuffixInput onSave={txt=> setFlo(txt||undefined)}
                        type="number"  value={ flo || ''}>m</SuffixInput>
              </InputLine>
              <InputLine label={`传动方式(型式):`}>
                <CommitInput  value={ 传动 || ''}  onSave={txt => set传动(txt||undefined) } />
              </InputLine>
              <InputLine label={`电动葫芦编号:`}>
                <CommitInput  value={ 葫芦号 || ''}  onSave={txt => set葫芦号(txt||undefined) } />
              </InputLine>
              <InputLine label={`电动葫芦型号:`}>
                <CommitInput  value={ 葫芦型 || ''}  onSave={txt => set葫芦型(txt||undefined) } />
              </InputLine>
              <InputLine label={`电动机编号:`}>
                <CommitInput  value={ 电机号 || ''}  onSave={txt => set电机号(txt||undefined) } />
              </InputLine>
              <InputLine label={`电动机功率:`}>
                <SuffixInput  onSave={txt=> set电机功率(txt||undefined)}
                              value={ 电机功率 || ''}>千瓦</SuffixInput>
              </InputLine>
              <InputLine label={`电动机类型:`}>
                <InputDatalist value={ 电动机类 || ''} datalist={电动机类型s}
                               onListChange={v => set电动机类(v ||undefined)} />
              </InputLine>
              <InputLine label={`电动机型号:`}>
                <CommitInput  value={ 电机型 || ''}  onSave={txt => set电机型(txt||undefined) } />
              </InputLine>
              <InputLine label={`电动机转速:`}>
                <SuffixInput  onSave={txt=> set电机转速(txt||undefined)}
                               value={ 电机转速 || ''}>转/min</SuffixInput>
              </InputLine>
              <InputLine label={`吊笼工作行程:`}>
                <SuffixInput  onSave={txt=> set笼行程(txt||undefined)}
                              value={ 笼行程 || ''}>m</SuffixInput>
              </InputLine>
              <InputLine label={`吊笼数量:`}>
                <SuffixInput  onSave={txt=> set笼数(txt||undefined)}
                              type="number"  value={ 笼数 || ''}>个</SuffixInput>
              </InputLine>
              <InputLine label={`顶层高度:`}>
                <SuffixInput  onSave={txt=> set顶层高度(txt||undefined)}
                              type="number"  value={ 顶层高度 || ''}>m</SuffixInput>
              </InputLine>
              <InputLine label={`对重轨距:`}>
                <SuffixInput  onSave={txt=> set对重轨距(txt||undefined)}
                              type="number"  value={ 对重轨距 || ''}>mm</SuffixInput>
              </InputLine>
              <InputLine label={`对重块数量:`}>
                <SuffixInput  onSave={txt=> set对重块数(txt||undefined)}
                               value={ 对重块数 || ''}>块</SuffixInput>
              </InputLine>
              <InputLine label={`对重绳直径:`}>
                <SuffixInput  onSave={txt=> set对绳径(txt||undefined)}
                               value={ 对绳径 || ''}>mm</SuffixInput>
              </InputLine>
              <InputLine label={`额定电流:`}>
                <SuffixInput  onSave={txt=> set额定电流(txt||undefined)}
                               value={ 额定电流 || ''}>A</SuffixInput>
              </InputLine>
              <InputLine label={`额定速度:`}>
                <SuffixInput  onSave={txt=> setVls(txt||undefined)}
                               value={ vls || ''}>m/s</SuffixInput>
              </InputLine>
              <InputLine label={`额定载人数:`}>
                <SuffixInput  onSave={txt=> set额定载人(txt||undefined)}
                              value={ 额定载人 || ''}>个人</SuffixInput>
              </InputLine>
              <InputLine label={`额定载重:`}>
                <SuffixInput  onSave={txt=> setRtlf(txt||undefined)}
                              type="number"  value={ rtlf || ''}>吨</SuffixInput>
              </InputLine>
              <InputLine label={`防爆标识:`}>
                <CommitInput  value={ 防爆标志 || ''}  onSave={txt => set防爆标志(txt||undefined) } />
              </InputLine>
              <InputLine label={`防坠安全器编号:`}>
                <CommitInput  value={ 坠安号 || ''}  onSave={txt => set坠安号(txt||undefined) } />
              </InputLine>
              <InputLine label={`防坠安全器型号:`}>
                <CommitInput  value={ 坠安型 || ''}  onSave={txt => set坠安型(txt||undefined) } />
              </InputLine>
              <InputLine label={`防坠落保护装置:`}>
                <CommitInput  value={ 坠保护 || ''}  onSave={txt => set坠保护(txt||undefined) } />
              </InputLine>
              <InputLine label={`附属装置设备品种:`}>
                <InputDatalist value={ 附属种 || ''} datalist={附属装置品种}
                               onListChange={v => set附属种(v ||undefined)} />
              </InputLine>
              <InputLine label={`工作方式:`}>
                <InputDatalist value={ 工作式 || ''} datalist={工作方式s}
                               onListChange={v => set工作式(v ||undefined)} />
              </InputLine>
              <InputLine label={`工作级别:`}>
                <Select inputSize="md"  value={ jobl || ''}
                        onChange={e => setJobl( e.currentTarget.value||undefined ) } >
                  <option></option>
                  { 工作级别.map((one,i) => (<option key={i}>{one}</option> )) } </Select>
              </InputLine>
              <InputLine label={`缓冲器编号:`}>
                <CommitInput  value={ 缓编号 || ''}  onSave={txt => set缓编号(txt||undefined) } />
              </InputLine>
              <InputLine label={`缓冲器型号:`}>
                <CommitInput  value={ 缓型号 || ''}  onSave={txt => set缓型号(txt||undefined) } />
              </InputLine>
              <InputLine label={`缓冲器形式:`}>
                <InputDatalist value={ 缓冲器 || ''} datalist={缓冲器形式}
                               onListChange={v => set缓冲器(v ||undefined)} />
              </InputLine>
              <InputLine label={`缓冲器制造单位:`}>
                <CommitInput  value={ 缓厂家 || ''}  onSave={txt => set缓厂家(txt||undefined) } />
              </InputLine>
              <InputLine label={`检验时导轨架高度:`}>
                <SuffixInput  onSave={txt=> set轨架高(txt||undefined)}
                              type="number"  value={ 轨架高 || ''}>m</SuffixInput>
              </InputLine>
              <InputLine label={`检验时吊笼数量:`}>
                <SuffixInput  onSave={txt=> set笼数检(txt||undefined)}
                              type="number"  value={ 笼数检 || ''}>个</SuffixInput>
              </InputLine>
              <InputLine label={`检验时对重数量:`}>
                <SuffixInput  onSave={txt=> set对块数检(txt||undefined)}
                               value={ 对块数检 || ''}>块</SuffixInput>
              </InputLine>
              <InputLine label={`检验时附墙架数量:`}>
                <SuffixInput  onSave={txt=> set附墙架(txt||undefined)}
                              type="number"  value={ 附墙架 || ''}>个</SuffixInput>
              </InputLine>
              <InputLine label={`轿厢轨距:`}>
                <SuffixInput  onSave={txt=> set轿厢轨距(txt||undefined)}
                              type="number"  value={ 轿厢轨距 || ''}>mm</SuffixInput>
              </InputLine>
              <InputLine label={`轿厢下行限速器电气动作速度:`}>
                <SuffixInput  onSave={txt=> set下限电速(txt||undefined)}
                              value={ 下限电速 || ''}>m/s</SuffixInput>
              </InputLine>
              <InputLine label={`轿厢下行限速器机械动作速度:`}>
                <SuffixInput  onSave={txt=> set下限机速(txt||undefined)}
                              value={ 下限机速 || ''}>m/s</SuffixInput>
              </InputLine>
              <InputLine label={`轿厢限速器编号:`}>
                <CommitInput  value={ 限速器号 || ''}  onSave={txt => set限速器号(txt||undefined) } />
              </InputLine>
              <InputLine label={`轿厢限速器型号:`}>
                <CommitInput  value={ 限速器型 || ''}  onSave={txt => set限速器型(txt||undefined) } />
              </InputLine>
              <InputLine label={`关门驱动方式:`}>
                <InputDatalist value={ 门式 || ''} datalist={关门驱动式}
                               onListChange={v => set门式(v ||undefined)} />
              </InputLine>
              <InputLine label={`开关门驱动方式:`}>
                <InputDatalist value={ 门驱动 || ''} datalist={门驱动方式}
                               onListChange={v => set门驱动(v ||undefined)} />
              </InputLine>
              <InputLine label={`开门方向/开门方式:`}>
                <InputDatalist value={ 门方向 || ''} datalist={开门方向}
                               onListChange={v => set门方向(v ||undefined)} />
              </InputLine>
              <InputLine label={`控制方式:`}>
                <InputDatalist value={ opm || ''} datalist={控制方式}
                               onListChange={v => setOpm(v ||undefined)} />
                {/*<Select inputSize="md"  value={ opm || ''}
                        onChange={e => setOpm( e.currentTarget.value||undefined ) } >
                  <option></option>
                  { 控制方式.map((one,i) => (<option key={i}>{one}</option> )) } </Select>*/}
              </InputLine>
              <InputLine label={`控制屏编号:`}>
                <CommitInput  value={ cpi || ''}  onSave={txt => setCpi(txt||undefined) } />
              </InputLine>
              <InputLine label={`控制屏型号:`}>
                <CommitInput  value={ cpm || ''}  onSave={txt => setCpm(txt||undefined) } />
              </InputLine>
              <InputLine label={`门数:`}>
                <SuffixInput  onSave={txt=> set门数(txt||undefined)}
                              type="number"  value={ 门数 || ''}>个</SuffixInput>
              </InputLine>
              <InputLine label={`起重力距:`}>
                <SuffixInput  onSave={txt=> setMom(txt||undefined)}
                             value={ mom || ''}>吨米</SuffixInput>
              </InputLine>
              <InputLine label={`伸展结构:`}>
                <CommitInput  value={ 伸展 || ''}  onSave={txt => set伸展(txt||undefined) } />
              </InputLine>
              <InputLine label={`使用环境:`}>
                <CommitInput  value={ 环境 || ''}  onSave={txt => set环境(txt||undefined) } />
              </InputLine>
              <InputLine label={`是否防爆:`}>
                <CheckSwitch checked={是防爆 || false} onChange={e => set是防爆(是防爆? undefined:true)} />
              </InputLine>
              <InputLine label={`是否非标:`}>
                <CheckSwitch checked={nnor || false} onChange={e => setNnor(nnor? undefined:true)} />
              </InputLine>
              <InputLine label={`是否绝缘:`}>
                <CheckSwitch checked={绝缘 || false} onChange={e => set绝缘(绝缘? undefined:true)} />
              </InputLine>
              <InputLine label={`是否双笼:`}>
                <CheckSwitch checked={twoc || false} onChange={e => setTwoc(twoc? undefined:true)} />
              </InputLine>
              <InputLine label={`是否有附属装置:`}>
                <CheckSwitch checked={有附装 || false} onChange={e => set有附装(有附装? undefined:true)} />
              </InputLine>
              <InputLine label={`速比:`}>
                <CommitInput  value={ 速比 || ''}  onSave={txt => set速比(txt||undefined) } />
              </InputLine>
              <InputLine label={`提升高度:`}>
                <SuffixInput id="hlf"  onSave={txt=> setHlf(txt||undefined)}
                              type="number"  value={ hlf || ''}>m</SuffixInput>
              </InputLine>
              <InputLine label={`提升绳直径:`}>
                <SuffixInput  onSave={txt=> set提绳径(txt||undefined)}
                              type="number"  value={ 提绳径 || ''}>mm</SuffixInput>
              </InputLine>
              <InputLine label={`拖动方式:`}>
                <InputDatalist value={ 拖动 || ''} datalist={拖动方式}
                               onListChange={v => set拖动(v ||undefined)} />
              </InputLine>
              <InputLine label={`限速器机械动作/安全器速度:`}>
                <SuffixInput  onSave={txt=> set限机械速(txt||undefined)}
                              value={ 限机械速 || ''}>m/s</SuffixInput>
              </InputLine>
              <InputLine label={`限速器绳直径:`}>
                <SuffixInput  onSave={txt=> set限绳直径(txt||undefined)}
                              type="number"  value={ 限绳直径 || ''}>mm</SuffixInput>
              </InputLine>
              <InputLine label={`型式试验样机:`}>
                <CommitInput  value={ 型试样 || ''}  onSave={txt => set型试样(txt||undefined) } />
              </InputLine>
              <InputLine label={`曳引比:`}>
                <CommitInput  value={ 曳引比 || ''}  onSave={txt => set曳引比(txt||undefined) } />
              </InputLine>
              <InputLine label={`曳引机编号:`}>
                <CommitInput  value={ tno || ''}  onSave={txt => setTno(txt||undefined) } />
              </InputLine>
              <InputLine label={`曳引机型号:`}>
                <CommitInput  value={ tm || ''}  onSave={txt => setTm(txt||undefined) } />
              </InputLine>
              <InputLine label={`曳引轮节径:`}>
                <SuffixInput  onSave={txt=> set轮节径(txt||undefined)}
                               value={ 轮节径 || ''}>mm</SuffixInput>
              </InputLine>
              <InputLine label={`曳引绳数:`}>
                <SuffixInput  onSave={txt=> set绳数(txt||undefined)}
                               value={ 绳数 || ''}>根</SuffixInput>
              </InputLine>
              <InputLine label={`曳引绳直径:`}>
                <SuffixInput onSave={txt=> set绳直径(txt||undefined)}
                              type="number"  value={ 绳直径 || ''}>mm</SuffixInput>
              </InputLine>
              <InputLine label={`用途:`}>
                <CommitInput  value={ 用途 || ''}  onSave={txt => set用途(txt||undefined) } />
              </InputLine>
              <InputLine label={`站数:`}>
                <SuffixInput  onSave={txt=> setNs(txt||undefined)}
                              type="number"  value={ ns || ''}>个</SuffixInput>
              </InputLine>
              <InputLine label={`自由端高度:`}>
                <SuffixInput  onSave={txt=> set自由高(txt||undefined)}
                              type="number"  value={ 自由高 || ''}>mm</SuffixInput>
              </InputLine>
              <InputLine label={`最大独立高度:`}>
                <SuffixInput  onSave={txt=> set独立高(txt||undefined)}
                              type="number"  value={ 独立高 || ''}>m</SuffixInput>
              </InputLine>
              <InputLine label={`最大起重幅度:`}>
                <SuffixInput  onSave={txt=> set最大幅(txt||undefined)}
                              type="number"  value={ 最大幅 || ''}>mm</SuffixInput>
              </InputLine>
              <InputLine label={`最大作业幅度:`}>
                <SuffixInput  onSave={txt=> set最工幅(txt||undefined)}
                              type="number"  value={ 最工幅 || ''}>mm</SuffixInput>
              </InputLine>
              <InputLine label={`作业人员:`}>
                <CommitInput  value={ 作业人 || ''}  onSave={txt => set作业人(txt||undefined) } />
              </InputLine>


            </LineColumn>

              <Text variant="h5">其它参数</Text>
              <Button size="lg" intent="primary"  iconAfter={<IconArrowRight />}
                      css={{ marginTop: theme.spaces.sm, whiteSpace:'unset' }}
                onPress={ async () => {
                  const eqpNew=await confirmation();
                  await mutationFunc(eqpNew);
                } }
              > 确认修改检查并保存到后端
              </Button>
            </div>
          </Container>
        </div>
      </div>

    </div>
  );
};

